Previous topicNext topic
Help > Keyword Reference >
TXT.INKEY$ method

Displays and inputs text on a specially created TEXT WINDOW. This is similar to a CONSOLE window, with some advantages. Generally speaking, a Text Window is more attractive. But, just like a Console Window, only fixed-width text may be displayed.

Syntax

TXT.membername(params)

RetVal = TXT.membername(params)

TXT.membername(params) TO ReturnVariable

Remarks

Text Windows offer a specific, but limited capability. They are very easy to implement and use, and they offer an excellent means to produce quick and straightforward programs in text mode.

Text Windows offer an excellent path for the beginning programmer, or for anyone who needs a procedural code model. As the name implies, they display only fixed-width text. Further, only one Text Window may exist at a time. If you need snazzy graphics, more specialized fonts, multiple windows, or a GUI interface, you should look to GRAPHIC WINDOWS and GRAPHIC CONTROLS instead.

Text Window methods are accessed like any other object. The object name TXT is followed by a period separator, and the name of the method or property:

TXT.Cell = RowValue&, ColumnVal&

Text Window methods which return a value may be used in two forms, a statement with a TO clause, or a function which may be used as a term in an expression:

TXT.Row TO RowVar&

RowVar& = TXT.Row

The two examples above are functionally identical. The choice is simply a matter of your personal preference. If you use the second form (as a function which returns a value), it can be a term in any expression of any complexity.

Most PowerBASIC functions specify graphic and pixel positions as x,y (the horizontal term first, then the vertical term). However, for compatibility with most current and prior versions of BASIC (PowerBASIC included), the functions which reference text rows and columns name the vertical term first (rows, columns).

Text Windows handle text wrapping and auto-scrolling much like a typical Console Window. When printing exceeds the end of a line, the print position wraps to the first column of the next row. When printing exceeds the last row, the entire page is scrolled to open a new line at the bottom.

In order to use the TXT object successfully, you must use care to first create a Text Window in your program. To do this, you can execute the TXT.WINDOW method.

All Text Windows are stable. They cannot be closed unexpectedly by the user, so there are no surprises when you find you are trying to print to a window which no longer exists. There is no Close Box, no System Menu, nor is ALT-F4 recognized as a close command. They can only be closed by executing TXT.END, or by terminating the entire application.

 

TXT METHODS